package com.cyn.controller;

import com.cyn.entity.Permission;
import com.cyn.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("admin")
public class MainController {

    @Autowired
    PermissionService permissionService;

    @RequestMapping("/")
    public String index() {

        List<Permission> permissionList =  permissionService.findByAdminUserId(2);

        return "index";
    }

    @RequestMapping("/detail")
    public String hello() {
        return "hello";
    }

    @RequestMapping("/login")
    public String login() {
        return "login";
    }
}